import http from "../utils/request"

// 获取验证码
export const getCaptcha = () => http.get("/users/getCaptcha?v=next")
// 校验验证码
export const verifyCaptcha =captcha=>http.get('/users/verifyCaptcha',{
    params:{
        captcha
    }
})
// 获取手机验证码
export let getSmsCode = (phoneNumber) => http.post('/sms/send', {
    phoneNumber
})

// 手机验证码登录
export let smsLogin = code => http.post("/users/login?type=sms", {
    code
})



// 常规登录
export const loginApi=(username,password)=>http.post('/users/login',{username,password})

// 获取二维码地址
export let getQrCodeApi = sid => http.get("/users/getQrcode", {
    params: {
        sid
    }
})
export let wechatLoginApi = wechatCode => http.get('/users/wechatLogin', {
    params: {
        wechatCode
    }
})